<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title></title>
		<!-- 开发环境版本，包含了有帮助的命令行警告 -->
		<script src="https://cdn.jsdelivr.net/npm/vue@2/dist/vue.js"></script>
	</head>
	<body>
		<div id="app-3">
			<p>{{message}}</p>
			<!-- v-on 指令添加一个事件监听器 -->
			<button v-on:click="reverseMessage">reverse</button>
		</div>
		<script type="text/javascript">
			var vue = new Vue({
				el: "#app-3",
				data: {
					message: "hello vue.js"
				},
				methods: {
					reverseMessage: function() {
						this.message = this.message.split('').reverse().join('');
					}
				}
			})
		</script>

	</body>
</html>
